<template>
  <view class="content">
    <scroll-view scroll-y="true" style="height: 920rpx">
      <view class="activeTime">
        <view class="time">
          <!-- <u-icon name="order" color="#ccc" size="40"></u-icon> -->
          <image class="img" src="@/static/community/time.png"></image>
          <view class="signTime">
            <view>报名时间:</view>
            <view>{{ activeInfo.signUpTime }}</view>
          </view>
        </view>
        <view class="time">
          <!-- <u-icon name="clock" color="#ccc" size="40"></u-icon> -->
          <image class="img" src="@/static/community/time2.png"></image>
          <view class="signTime">
            <view>报名时间:</view>
            <view>{{ activeInfo.signUpTime }}</view>
          </view>
        </view>
        <view class="activeNum">
          <view class="active">
            <!-- <u-icon name="account" color="#ccc" size="40"></u-icon> -->
            <image class="img" src="@/static/community/people.png"></image>
            <view>报名人数:{{ activeInfo.signUpNum }} </view>
          </view>
          <view class="active">剩余名额:{{ activeInfo.surplusNum }} </view>
        </view>
      </view>
      <view class="details">
        {{ activeInfo.details }}
      </view>
    </scroll-view>
    <view class="subBtn">
      <button class="sub" v-if="signUpEndTime > now" @tap="gosign">
        立即报名
      </button>
      <button class="subend" v-if="signUpEndTime < now" @tap="gosign">
        报名结束
      </button>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    activeInfo: {
      type: Object,
      default: {},
    },
    signUpEndTime: {
      type: String,
      default: "",
    },
    now: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  methods: {
    gosign() {
      uni.navigateTo({
        url: "/pages/community/active/sign",
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.content {
  padding: 0 30rpx;
  .activeTime {
    margin-top: 40rpx;
    .time {
      display: flex;
      align-items: center;
      margin-top: 30rpx;
      .img {
        width: 30rpx;
        height: 30rpx;
      }
      .signTime {
        display: flex;
        align-items: center;
        margin-left: 20rpx;
      }
    }
    .activeNum {
      margin-top: 30rpx;
      display: flex;
      align-items: center;
      .active {
        flex: 1;
        display: flex;
        align-items: center;
        .img {
          width: 30rpx;
          height: 30rpx;
          margin-right: 20rpx;
        }
      }
    }
  }
  .details {
    margin-top: 20rpx;
    font-size: 28rpx;
    text-indent: 56rpx;
    line-height: 48rpx;
  }
  .subBtn {
    width: 100%;
    padding: 30rpx 0;
    .sub {
      width: 80%;
      height: 100rpx;
      line-height: 100rpx;
      text-align: center;
      color: #fff;
      background-color: #f00;
      border-radius: 50rpx;
    }
    .subend{
      width: 80%;
      height: 100rpx;
      line-height: 100rpx;
      text-align: center;
      color: #fff;
      background-color: #ACACAC;
      border-radius: 50rpx;
    }
  }
}
</style>